Note

The video above is from an older version of the course. You might find it helpful to watch it as an example of prototyping a workspace, but you don't have to follow along. See the Exercise below for details.

Learning Objectives

After completing this lesson, you’ll be able to:

Resources

Rejected Features

An essential part of any workflow is handling data that fails to process, for example, when a feature with no geometry is sent into a geometry-based transformer like the AreaBuilder.

FME handles such failures by outputting the data through <Rejected> ports, which are found on many transformers:

Rejected ports

A parameter exists to control the action of <Rejected> ports and gives the workspace author a choice over what action to take.

When a feature is rejected, the translation will stop, and a red circle with a number will appear on the <Rejected> port. You can click on the cache to inspect the feature and determine why it was rejected:

A Rejected port with a feature cache

Rejected Feature Handling

The parameter to control the handling of rejected features can be found in the Navigator window under Workspace Parameters:

The Rejected Feature Handling parameter in the Navigator

The two options are Terminate Translation and Continue Translation.

When the parameter is set to Terminate Translation, a feature exiting via a <Rejected> port causes the translation to stop. To visually denote this, the <Rejected> ports have a small black marker:

Rejected port with Terminate mode enabled

When the parameter is set to Continue Translation, the translation will continue to run regardless of how many features exit <Rejected> ports. In that case, the small black marker is removed:

Rejected port with Continue mode enabled

In Terminate Translation mode, a rejected feature gets written to the log window with the error message:

The below feature caused the translation to be terminated

There will also be an error message relating to the transformer:

Intersector_<Rejected>(TeeFactory): Intersector_<Rejected>: Termination Message: 'Intersector output a <Rejected> feature.

This error is helpful because it tells the author which transformer experienced the failure.

Note

To quickly find these error messages, you can filter the Translation Log by clicking the Errors button.

Mixed Mode

There is an important exception to the behavior of Terminate Translation mode: a rejected feature will not cause the translation to stop if the <Rejected> port is connected to a further object:

Terminate mode with a connected Rejected port

In short, an author can create a mixed mode, where some transformers stop the translation on rejecting a feature (the Intersector above) while others will handle the feature another way (the Bufferer). That way, the author can try to handle rejected expected features but stop the translation if there are genuinely unexpected failures.

Note

Generally:

Another important fact is that just because a feature is not rejected does not mean the results are 100% correct! FME will only reject features based on specific problems. It doesn't know if your workspace is actually doing what you intend; that's up to you to determine.

Feature Counts and Inspection

In continue mode, features that exit a <Rejected> port are counted and saved for inspection:

A Rejected port with a feature cache using Continue mode

FME will save features for inspection even if you do not attach a Logger or other transformer. The number tells us how many features were rejected, and the green icon can be clicked to inspect the data.

Exercise

JenniferSven

Jennifer is helping Sven understand how rejected features work in FME. She's created a challenge for him to test his knowledge.

Steps

  1. Open the starting workspace
  2. Run it to generate feature caches.
    1. The workspace parameter Workspace Feature Handling is set to Continue Translation so that you can see the results.
  3. Read the annotation for each bookmark to understand what the workspace author hopes to achieve.
  4. Decide if the workspace author should terminate the translation when rejected features are created for each section, if something else is going wrong, or if it is correct.
  5. The quiz will ask you about your choices. There is a correct and an incorrect approach here!

Hints